<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.css"/>
<link rel="stylesheet" href="<%=basePath %>css/buttons.css" />
<script src="<%=basePath %>js/Form validation/jquery-1.4.4.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="<%=basePath %>css/Form validation/validator.css"></link>
<script src="<%=basePath %>js/Form validation/formValidator-4.0.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="<%=basePath %>js/Form validation/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<script type="text/javascript">
$(document).ready(function(){
	$("#save").click(function() {
        var $form = $("form");
        $.ajax({
            cache: true,
            type: "POST",
            url: $form.attr("action"),	//提交的url
            data: $form.serialize(),
            async: false,
            success: function (data) {
            	if( data.indexOf("成功") > 0 ){
            		alert("修改成功！");
            	}else{
            		alert("出错了！");
            		location.reload();
            	}
            },
            error: function (request) {
                alert(request);
                location.reload();
            }
        });
    });
	$("#exit").click(function(){
		location.href = "<%=basePath %>index.jsp";
	});
});

</script>

<body onload="">
	<br />
	<center>
		<form action="<%=basePath %>paramininfo/update" method="post" role="form" id="form1">
			<table width="750" cellpadding="0" border="0">
 				<c:forEach items="${paramList }" var="paramList"> 
					<tr>
						<td  align="right" width="350">身高>=：</td>
						<td><input id="fheight" name="fheight" value="${paramList.fheight }" class="form-control" style="width:160px;height:25px;"></td>
					</tr>	
						<tr>
							<td align="right">体重>=：</td>
							<td><input type="text" id="fweight" name="fweight" value="${paramList.fweight }" class="form-control" style="width:160px;height:25px;"></td>
						</tr>	
					</c:forEach>
					<tr>
						<td colspan="3" align="center">
							<br />
							<input type="button" value=" 保  存 " id="save" onclick="" 
							class="button button-pill button-primary" style="width:140px;height:40px;">&nbsp;&nbsp;
							<input type="button" value=" 返  回 " id="exit"  
							class="button button-pill button-primary" style="width:140px;height:40px;">
						</td>
					</tr>
			</table>
		</form>
	</center>
</body>
</html>